require 'socket'

server = Socket.new :INET,:STREAM
addr = Socket.pack_sockaddr_in(4491,'0.0.0.0')

server.bind(addr)
server.listen(128)

conn,_ = server.accept
# 创建链接副本
copy = conn.dup
# 关闭所有副本上的通讯
conn.shutdown
# 关闭原始链接
conn.close